<!DOCTYPE HTML>
<html lang="zh-CN">


<head>
    <meta charset="utf-8">
    <meta name="keywords" content="Maven, 鸟鸟">
    <meta name="description" content="大家好，我是鸟鸟，今年20岁，喜欢打篮球，搭建的这个博客是用来记录平时的一些学习笔记和心得">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <!-- Global site tag (gtag.js) - Google Analytics -->


    <title>Maven | 鸟鸟</title>
    <link rel="icon" type="image/png" href="/yueyueniao-gif/favicon.png">

    <link rel="stylesheet" type="text/css" href="/yueyueniao-gif/libs/awesome/css/all.css">
    <link rel="stylesheet" type="text/css" href="/yueyueniao-gif/libs/materialize/materialize.min.css">
    <link rel="stylesheet" type="text/css" href="/yueyueniao-gif/libs/aos/aos.css">
    <link rel="stylesheet" type="text/css" href="/yueyueniao-gif/libs/animate/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/yueyueniao-gif/libs/lightGallery/css/lightgallery.min.css">
    <link rel="stylesheet" type="text/css" href="/yueyueniao-gif/css/matery.css">
    <link rel="stylesheet" type="text/css" href="/yueyueniao-gif/css/my.css">

    <script src="/yueyueniao-gif/libs/jquery/jquery.min.js"></script>

<meta name="generator" content="Hexo 5.0.2"><link rel="alternate" href="/yueyueniao-gif/atom.xml" title="鸟鸟" type="application/atom+xml">
<link rel="stylesheet" href="/yueyueniao-gif/css/prism-tomorrow.css" type="text/css"></head>


<body>
    <header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="nav-wrapper container">
            <div class="brand-logo">
                <a href="/yueyueniao-gif/" class="waves-effect waves-light">
                    
                    <img src="/yueyueniao-gif/medias/logo.png" class="logo-img" alt="LOGO">
                    
                    <span class="logo-span">鸟鸟</span>
                </a>
            </div>
            

<a href="#" data-target="mobile-nav" class="sidenav-trigger button-collapse"><i class="fas fa-bars"></i></a>
<ul class="right nav-menu">
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/yueyueniao-gif/" class="waves-effect waves-light">
      
      <i class="fas fa-home" style="zoom: 0.6;"></i>
      
      <span>首页</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/yueyueniao-gif/tags" class="waves-effect waves-light">
      
      <i class="fas fa-tags" style="zoom: 0.6;"></i>
      
      <span>标签</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/yueyueniao-gif/categories" class="waves-effect waves-light">
      
      <i class="fas fa-bookmark" style="zoom: 0.6;"></i>
      
      <span>分类</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/yueyueniao-gif/archives" class="waves-effect waves-light">
      
      <i class="fas fa-archive" style="zoom: 0.6;"></i>
      
      <span>归档</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/yueyueniao-gif/about" class="waves-effect waves-light">
      
      <i class="fas fa-user-circle" style="zoom: 0.6;"></i>
      
      <span>关于</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/yueyueniao-gif/contact" class="waves-effect waves-light">
      
      <i class="fas fa-comments" style="zoom: 0.6;"></i>
      
      <span>留言板</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/yueyueniao-gif/friends" class="waves-effect waves-light">
      
      <i class="fas fa-address-book" style="zoom: 0.6;"></i>
      
      <span>友情链接</span>
    </a>
    
  </li>
  
  <li>
    <a href="#searchModal" class="modal-trigger waves-effect waves-light">
      <i id="searchIcon" class="fas fa-search" title="搜索" style="zoom: 0.85;"></i>
    </a>
  </li>
</ul>


<div id="mobile-nav" class="side-nav sidenav">

    <div class="mobile-head bg-color">
        
        <img src="/yueyueniao-gif/medias/logo.png" class="logo-img circle responsive-img">
        
        <div class="logo-name">鸟鸟</div>
        <div class="logo-desc">
            
            大家好，我是鸟鸟，今年20岁，喜欢打篮球，搭建的这个博客是用来记录平时的一些学习笔记和心得
            
        </div>
    </div>

    

    <ul class="menu-list mobile-menu-list">
        
        <li class="m-nav-item">
	  
		<a href="/yueyueniao-gif/" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-home"></i>
			
			首页
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/yueyueniao-gif/tags" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-tags"></i>
			
			标签
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/yueyueniao-gif/categories" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-bookmark"></i>
			
			分类
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/yueyueniao-gif/archives" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-archive"></i>
			
			归档
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/yueyueniao-gif/about" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-user-circle"></i>
			
			关于
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/yueyueniao-gif/contact" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-comments"></i>
			
			留言板
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/yueyueniao-gif/friends" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-address-book"></i>
			
			友情链接
		</a>
          
        </li>
        
        
        <li><div class="divider"></div></li>
        <li>
            <a href="https://github.com/blinkfox/hexo-theme-matery" class="waves-effect waves-light" target="_blank">
                <i class="fab fa-github-square fa-fw"></i>Fork Me
            </a>
        </li>
        
    </ul>
</div>


        </div>

        
            <style>
    .nav-transparent .github-corner {
        display: none !important;
    }

    .github-corner {
        position: absolute;
        z-index: 10;
        top: 0;
        right: 0;
        border: 0;
        transform: scale(1.1);
    }

    .github-corner svg {
        color: #0f9d58;
        fill: #fff;
        height: 64px;
        width: 64px;
    }

    .github-corner:hover .octo-arm {
        animation: a 0.56s ease-in-out;
    }

    .github-corner .octo-arm {
        animation: none;
    }

    @keyframes a {
        0%,
        to {
            transform: rotate(0);
        }
        20%,
        60% {
            transform: rotate(-25deg);
        }
        40%,
        80% {
            transform: rotate(10deg);
        }
    }
</style>

<a href="https://github.com/blinkfox/hexo-theme-matery" class="github-corner tooltipped hide-on-med-and-down" target="_blank"
   data-tooltip="Fork Me" data-position="left" data-delay="50">
    <svg viewBox="0 0 250 250" aria-hidden="true">
        <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
        <path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
              fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
        <path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
              fill="currentColor" class="octo-body"></path>
    </svg>
</a>
        
    </nav>

</header>

    



<div class="bg-cover pd-header post-cover" style="background-image: url('/yueyueniao-gif/medias/featureimages/11.jpg')">
    <div class="container" style="right: 0px;left: 0px;">
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="brand">
                    <h1 class="description center-align post-title">Maven</h1>
                </div>
            </div>
        </div>
    </div>
</div>




<main class="post-container content">

    
    <link rel="stylesheet" href="/yueyueniao-gif/libs/tocbot/tocbot.css">
<style>
    #articleContent h1::before,
    #articleContent h2::before,
    #articleContent h3::before,
    #articleContent h4::before,
    #articleContent h5::before,
    #articleContent h6::before {
        display: block;
        content: " ";
        height: 100px;
        margin-top: -100px;
        visibility: hidden;
    }

    #articleContent :focus {
        outline: none;
    }

    .toc-fixed {
        position: fixed;
        top: 64px;
    }

    .toc-widget {
        width: 345px;
        padding-left: 20px;
    }

    .toc-widget .toc-title {
        margin: 35px 0 15px 0;
        padding-left: 17px;
        font-size: 1.5rem;
        font-weight: bold;
        line-height: 1.5rem;
    }

    .toc-widget ol {
        padding: 0;
        list-style: none;
    }

    #toc-content {
        height: calc(100vh - 250px);
        overflow: auto;
    }

    #toc-content ol {
        padding-left: 10px;
    }

    #toc-content ol li {
        padding-left: 10px;
    }

    #toc-content .toc-link:hover {
        color: #42b983;
        font-weight: 700;
        text-decoration: underline;
    }

    #toc-content .toc-link::before {
        background-color: transparent;
        max-height: 25px;

        position: absolute;
        right: 23.5vw;
        display: block;
    }

    .toc-fixed .toc-link::before{
        position: fixed!important;/*当toc的位置改为fixed时，.toc-link::before也要改为fixed*/
    }

    #toc-content .is-active-link {
        color: #42b983;
    }

    #toc-content .is-active-link::before {
        background-color: #42b983;
    }

    #floating-toc-btn {
        position: fixed;
        right: 15px;
        bottom: 76px;
        padding-top: 15px;
        margin-bottom: 0;
        z-index: 998;
    }

    #floating-toc-btn .btn-floating {
        width: 48px;
        height: 48px;
    }

    #floating-toc-btn .btn-floating i {
        line-height: 48px;
        font-size: 1.4rem;
    }
</style>
<div class="row">
    <div id="main-content" class="col s12 m12 l9">
        <!-- 文章内容详情 -->
<div id="artDetail">
    <div class="card">
        <div class="card-content article-info">
            <div class="row tag-cate">
                <div class="col s7">
                    
                    <div class="article-tag">
                        
                            <a href="/yueyueniao-gif/tags/maven/">
                                <span class="chip bg-color">maven</span>
                            </a>
                        
                    </div>
                    
                </div>
                <div class="col s5 right-align">
                    
                    <div class="post-cate">
                        <i class="fas fa-bookmark fa-fw icon-category"></i>
                        
                            <a href="/yueyueniao-gif/categories/maven/" class="post-category">
                                maven
                            </a>
                        
                    </div>
                    
                </div>
            </div>

            <div class="post-info">
                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-minus fa-fw"></i>发布日期:&nbsp;&nbsp;
                    2020-08-18
                </div>
                

                

                
                <div class="info-break-policy">
                    <i class="far fa-file-word fa-fw"></i>文章字数:&nbsp;&nbsp;
                    1.8k
                </div>
                

                

                
            </div>
        </div>
        <hr class="clearfix">
        <div class="card-content article-card-content">
            <div id="articleContent">
                <h3 id="Maven的下载安装参考传送门"><a href="#Maven的下载安装参考传送门" class="headerlink" title="Maven的下载安装参考传送门"></a>Maven的下载安装参考<a target="_blank" rel="noopener" href="https://www.cnblogs.com/xdp-gacl/p/3498271.html">传送门</a></h3><h3 id="Maven工程"><a href="#Maven工程" class="headerlink" title="Maven工程"></a>Maven工程</h3><pre><code>POM工程
POM 工程是逻辑工程。用在父级工程或聚合工程中。用来做 jar 包的版本控制。

JAR工程
将会打包成 jar 用作 jar 包使用。即常见的本地工程     -Java Project

WAR工程
将会打包成 war，发布在服务器上的工程。如网站或服务。即常见的网络工程 - Dynamic Web Project。
war工程默认没有 WEB-INF 目录及 web.xml 配置文件，IDE 通常会显示工程 错误，提供完整工程结构可以解决。</code></pre>
<h5 id="创建maven工程师的目录"><a href="#创建maven工程师的目录" class="headerlink" title="创建maven工程师的目录"></a>创建maven工程师的目录</h5><pre><code>Group Id 公司域名倒写 
Artifact Id 项目名 
Version 版本名 
Packaging 项目类型 
Jar java 项目 
War : web 项目 
POM: 父项目.如果项目有子项目,项目必须是 pom 
Name : 自定义名称,内容任意 
Description: 描述.详细描述. 
Parent Project: 如果当前项目有父项目时填写</code></pre>
<h5 id="maven项目结构"><a href="#maven项目结构" class="headerlink" title="maven项目结构"></a>maven项目结构</h5><pre><code>src/main/java 这个目录下储存 java 源代码 
src/main/resources 储存主要的资源文件。比如spring的xml配置文件和log4j的properties 文件。 src/test/java 储存测试用的类，比如 JUNIT 的测试一般就放在这个目录下面 
src/test/resources 储存测试用的资源文件 
src 包含了项目所有的源代码和资源文件，以及其他项目相关的文件。 
target 编译后内容放置的文件夹
pom.xml 是 Maven 的基础配置文件。配置项目和项目之间关系，包括配置依赖关系等 等</code></pre>
<h5 id="工程关系"><a href="#工程关系" class="headerlink" title="工程关系"></a>工程关系</h5><h6 id="依赖"><a href="#依赖" class="headerlink" title="依赖"></a>依赖</h6><p>即 A 工程开发或运行过程中需要 B 工程提供支持，则代表 A 工程依赖 B 工程。在这种 </p>
<p>情况下，需要在 pom.xml 文件中增加下属配置定义依赖关系</p>
<pre><code>&lt;dependencies&gt; 
    &lt;!-- 定义一个具体的依赖 --&gt;
    &lt;dependency&gt; 
        &lt;!-- 依赖的工程所在组名 --&gt;
        &lt;groupId&gt;groupName&lt;/groupId&gt; 
        &lt;!-- 依赖的工程名 --&gt; 
        &lt;artifactId&gt;artifactName&lt;/artifactId&gt;
        &lt;!-- 依赖的工程版本 --&gt; 
        &lt;version&gt;versionNo&lt;/version&gt; 
        &lt;!-- 依赖的工程有效范围，其可选值有： 
        compile - 编译中有效 
        runtime - 运行中有效 
        system - 全部中有效[默认] 
        provided - 当前工程中有效. 
        test - 只在测试有效 --&gt;
        &lt;scope&gt;system&lt;/scope&gt; 
    &lt;/dependency&gt; 
&lt;/dependencies&gt;</code></pre>
<h6 id="继承"><a href="#继承" class="headerlink" title="继承"></a>继承</h6><p>如果 A 工程继承 B 工程，则代表 A 工程默认依赖 B 工程依赖的所有资源，且可以应用 </p>
<p>B 工程中定义的所有资源信息。被继承的工程（B 工程）只能是 POM 工程。</p>
<h6 id="聚合"><a href="#聚合" class="headerlink" title="聚合"></a>聚合</h6><p>当我们开发的工程拥有 2 个以上模块的时候，每个模块都是一个独立的功能集合。比如 某大学系统中拥有搜索平台，学习平台，考试平台等。开发的时候每个平台都可以独立编译， 测试，运行。这个时候我们就需要一个聚合工程。 在创建聚合工程的过程中，总的工程必须是一个 POM 工程（Maven Project），各子模 块可以是任意类型模块（Maven Module）。所有聚合工程和聚合模块必须处于同一个组 （groupId）中，且聚合工程可以嵌套</p>
<h3 id="Maven常用命令"><a href="#Maven常用命令" class="headerlink" title="Maven常用命令"></a>Maven常用命令</h3><pre><code>1 install 本地安装， 包含编译，打包，安装到本地仓库 编译 - javac 打包 - jar， 将 java 代码打包为 jar 文件 安装到本地仓库 - 将打包的 jar 文件，保存到本地仓库目录中。 

2 clean 清除已编译信息。 删除工程中的 target 目录。 

3 compile 只编译。 javac 命令 

4 deploy 部署。 常见于结合私服使用的命令。 相当于是 install+上传 jar 到私服。 包含编译，打包，安装到本地仓库，上传到私服仓库。 

5 package 打包。 包含编译，打包两个功能。</code></pre>
<h3 id="项目架构设计"><a href="#项目架构设计" class="headerlink" title="项目架构设计"></a>项目架构设计</h3><ul>
<li>传统项目设计方式</li>
</ul>
<p><img src="https://s3.jpg.cm/2020/08/18/ubnZr.png"></p>
<ul>
<li>maven项目设计方式</li>
</ul>
<p><img src="https://s3.jpg.cm/2020/08/18/ub7X5.png"></p>
<h4 id="创建工程"><a href="#创建工程" class="headerlink" title="创建工程"></a>创建工程</h4><h6 id="先创建Parent工程"><a href="#先创建Parent工程" class="headerlink" title="先创建Parent工程"></a>先创建Parent工程</h6><ol>
<li><p>创建完父工程，将父工程的src删掉就可以了，因为父工程的作用是管理jar包  不参与任何逻辑算法。</p>
</li>
<li><p>pom.xml依赖</p>
<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;

    &lt;groupId&gt;com.wangyueniao&lt;/groupId&gt;
    &lt;artifactId&gt;aaa&lt;/artifactId&gt;
    &lt;!--父工程打包方式为pom--&gt;
    &lt;packaging&gt;pom&lt;/packaging&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;

    &lt;!--modules 模块标签
      1.  所有的父级工程  作用是管理jar包  不参与任何逻辑算法。所以可以干掉 SRC
      2.  列举了父工程中的所有子模块,子工程可以自动继承父级工程中的jar包  
      3.  每一个子模块都代表了不同的包（package）
    --&gt;

    &lt;!--表示该父工程下的子工程--&gt;
    &lt;modules&gt;
        &lt;module&gt;bbb&lt;/module&gt;
        &lt;module&gt;ccc&lt;/module&gt;
        &lt;module&gt;ddd&lt;/module&gt;
        &lt;module&gt;eee&lt;/module&gt;
    &lt;/modules&gt;

    &lt;properties&gt;
        &lt;!-- 声明属性，对Spring的版本进行统一管理 --&gt;
        &lt;wangyueniao.spring.version&gt;4.3.20.RELEASE&lt;/wangyueniao.spring.version&gt;
    &lt;/properties&gt;

1. 被&lt;denpencyManagement&gt;所控制的jar包，不会被子工程所继承，如果子工程有需要，可以重写父工程中的jar包，并且不需要携带版本号
2. 如果不省略版本号，则jar包会从maven中进行下载，并不再是从父工程中重写的jar包
&lt;dependencyManagement&gt;
    &lt;dependencies&gt;
        &lt;!-- 在父级工程中，添加一些jar 包。 mysql的驱动包 --&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;mysql&lt;/groupId&gt;
            &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
            &lt;version&gt;5.1.38&lt;/version&gt;
        &lt;/dependency&gt;

       &lt;dependency&gt;
                &lt;groupId&gt;org.springframework&lt;/groupId&gt;
                &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
                &lt;version&gt;$&amp;#123;wangyueniao.spring.version&amp;#125;&lt;/version&gt;
       &lt;/dependency&gt;

        &lt;dependency&gt;
                &lt;groupId&gt;org.springframework&lt;/groupId&gt;
                &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
                &lt;version&gt;$&amp;#123;wangyueniao.spring.version&amp;#125;&lt;/version&gt;
        &lt;/dependency&gt;

        &lt;!--
            spring
        --&gt;

        &lt;!--
            mybatis
        --&gt;

        &lt;!--
            shiro
        --&gt;
    &lt;/dependencies&gt;
    &lt;/dependencyManagement&gt;
&lt;/project&gt;
</code></pre>
<h6 id=""><a href="#" class="headerlink" title=""></a></h6></li>
</ol>
<h6 id="创建子工程，以bbb为例"><a href="#创建子工程，以bbb为例" class="headerlink" title="创建子工程，以bbb为例"></a>创建子工程，以bbb为例</h6><pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
         &lt;!--表示该工程的父工程--&gt;
    &lt;parent&gt;
        &lt;artifactId&gt;aaa&lt;/artifactId&gt;
        &lt;groupId&gt;com.wangyueniao&lt;/groupId&gt;
        &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
    &lt;/parent&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;

    &lt;artifactId&gt;bbb&lt;/artifactId&gt;

    &lt;!--
      1.  子工程如果需要，重写父级工程的jar包即可，但是不能 携带版本号
      2.将父级工程中的jar包 直接复制过来，但是不可携带版本号。
    --&gt;

    &lt;dependencies&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;mysql&lt;/groupId&gt;
            &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
        &lt;/dependency&gt;

          &lt;dependency&gt;
                &lt;groupId&gt;org.springframework&lt;/groupId&gt;
                &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
       &lt;/dependency&gt;
    &lt;/dependencies&gt;


&lt;/project&gt;</code></pre>
<script>
        document.querySelectorAll('.github-emoji')
          .forEach(el => {
            if (!el.dataset.src) { return; }
            const img = document.createElement('img');
            img.style = 'display:none !important;';
            img.src = el.dataset.src;
            img.addEventListener('error', () => {
              img.remove();
              el.style.color = 'inherit';
              el.style.backgroundImage = 'none';
              el.style.background = 'none';
            });
            img.addEventListener('load', () => {
              img.remove();
            });
            document.body.appendChild(img);
          });
      </script>
            </div>
            <hr/>

            

    <div class="reprint" id="reprint-statement">
        
            <div class="reprint__author">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-user">
                        文章作者:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="https://gitee.com/yueyueniao-gif/yueyueniao-gif.git" rel="external nofollow noreferrer">Wang Yue Niao</a>
                </span>
            </div>
            <div class="reprint__type">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-link">
                        文章链接:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="https://gitee.com/yueyueniao-gif/yueyueniao-gif.git/yueyueniao-gif/2020/08/18/maven/">https://gitee.com/yueyueniao-gif/yueyueniao-gif.git/yueyueniao-gif/2020/08/18/maven/</a>
                </span>
            </div>
            <div class="reprint__notice">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-copyright">
                        版权声明:
                    </i>
                </span>
                <span class="reprint-info">
                    本博客所有文章除特別声明外，均采用
                    <a href="https://creativecommons.org/licenses/by/4.0/deed.zh" rel="external nofollow noreferrer" target="_blank">CC BY 4.0</a>
                    许可协议。转载请注明来源
                    <a href="https://gitee.com/yueyueniao-gif/yueyueniao-gif.git" target="_blank">Wang Yue Niao</a>
                    !
                </span>
            </div>
        
    </div>

    <script async defer>
      document.addEventListener("copy", function (e) {
        let toastHTML = '<span>复制成功，请遵循本文的转载规则</span><button class="btn-flat toast-action" onclick="navToReprintStatement()" style="font-size: smaller">查看</a>';
        M.toast({html: toastHTML})
      });

      function navToReprintStatement() {
        $("html, body").animate({scrollTop: $("#reprint-statement").offset().top - 80}, 800);
      }
    </script>



            <div class="tag_share" style="display: block;">
                <div class="post-meta__tag-list" style="display: inline-block;">
                    
                        <div class="article-tag">
                            
                                <a href="/yueyueniao-gif/tags/maven/">
                                    <span class="chip bg-color">maven</span>
                                </a>
                            
                        </div>
                    
                </div>
                <div class="post_share" style="zoom: 80%; width: fit-content; display: inline-block; float: right; margin: -0.15rem 0;">
                    <link rel="stylesheet" type="text/css" href="/yueyueniao-gif/libs/share/css/share.min.css">
<div id="article-share">

    
    <div class="social-share" data-sites="twitter,facebook,google,qq,qzone,wechat,weibo,douban,linkedin" data-wechat-qrcode-helper="<p>微信扫一扫即可分享！</p>"></div>
    <script src="/yueyueniao-gif/libs/share/js/social-share.min.js"></script>
    

    

</div>

                </div>
            </div>
            
                <style>
    #reward {
        margin: 40px 0;
        text-align: center;
    }

    #reward .reward-link {
        font-size: 1.4rem;
        line-height: 38px;
    }

    #reward .btn-floating:hover {
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.2);
    }

    #rewardModal {
        width: 320px;
        height: 350px;
    }

    #rewardModal .reward-title {
        margin: 15px auto;
        padding-bottom: 5px;
    }

    #rewardModal .modal-content {
        padding: 10px;
    }

    #rewardModal .close {
        position: absolute;
        right: 15px;
        top: 15px;
        color: rgba(0, 0, 0, 0.5);
        font-size: 1.3rem;
        line-height: 20px;
        cursor: pointer;
    }

    #rewardModal .close:hover {
        color: #ef5350;
        transform: scale(1.3);
        -moz-transform:scale(1.3);
        -webkit-transform:scale(1.3);
        -o-transform:scale(1.3);
    }

    #rewardModal .reward-tabs {
        margin: 0 auto;
        width: 210px;
    }

    .reward-tabs .tabs {
        height: 38px;
        margin: 10px auto;
        padding-left: 0;
    }

    .reward-content ul {
        padding-left: 0 !important;
    }

    .reward-tabs .tabs .tab {
        height: 38px;
        line-height: 38px;
    }

    .reward-tabs .tab a {
        color: #fff;
        background-color: #ccc;
    }

    .reward-tabs .tab a:hover {
        background-color: #ccc;
        color: #fff;
    }

    .reward-tabs .wechat-tab .active {
        color: #fff !important;
        background-color: #22AB38 !important;
    }

    .reward-tabs .alipay-tab .active {
        color: #fff !important;
        background-color: #019FE8 !important;
    }

    .reward-tabs .reward-img {
        width: 210px;
        height: 210px;
    }
</style>

<div id="reward">
    <a href="#rewardModal" class="reward-link modal-trigger btn-floating btn-medium waves-effect waves-light red">赏</a>

    <!-- Modal Structure -->
    <div id="rewardModal" class="modal">
        <div class="modal-content">
            <a class="close modal-close"><i class="fas fa-times"></i></a>
            <h4 class="reward-title">你的赏识是我前进的动力</h4>
            <div class="reward-content">
                <div class="reward-tabs">
                    <ul class="tabs row">
                        <li class="tab col s6 alipay-tab waves-effect waves-light"><a href="#alipay">支付宝</a></li>
                        <li class="tab col s6 wechat-tab waves-effect waves-light"><a href="#wechat">微 信</a></li>
                    </ul>
                    <div id="alipay">
                        <img src="/yueyueniao-gif/medias/reward/alipay.jpg" class="reward-img" alt="支付宝打赏二维码">
                    </div>
                    <div id="wechat">
                        <img src="/yueyueniao-gif/medias/reward/wechat.png" class="reward-img" alt="微信打赏二维码">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        $('.tabs').tabs();
    });
</script>

            
        </div>
    </div>

    

    

    

    

    

    

    

<article id="prenext-posts" class="prev-next articles">
    <div class="row article-row">
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge left-badge text-color">
                <i class="fas fa-chevron-left"></i>&nbsp;上一篇</div>
            <div class="card">
                <a href="/yueyueniao-gif/2020/08/18/shiro/">
                    <div class="card-image">
                        
                        
                        <img src="/yueyueniao-gif/medias/featureimages/1.jpg" class="responsive-img" alt="Shiro">
                        
                        <span class="card-title">Shiro</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            Shiro简介
Apache Shiro 是一个Java 的安全（权限）框架。

Shiro 可以非常容易的开发出足够好的应用，其不仅可以用在JavaSE环境，也可以用在JavaEE环 境。

Shiro可以完成，认证，授权，加密，会话管理
                        
                    </div>
                    <div class="publish-info">
                        <span class="publish-date">
                            <i class="far fa-clock fa-fw icon-date"></i>2020-08-18
                        </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/yueyueniao-gif/categories/%E6%9D%83%E9%99%90%E6%8E%A7%E5%88%B6/" class="post-category">
                                    权限控制
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/yueyueniao-gif/tags/Shiro/">
                        <span class="chip bg-color">Shiro</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge right-badge text-color">
                下一篇&nbsp;<i class="fas fa-chevron-right"></i>
            </div>
            <div class="card">
                <a href="/yueyueniao-gif/2020/08/18/git/">
                    <div class="card-image">
                        
                        
                        <img src="/yueyueniao-gif/medias/featureimages/10.jpg" class="responsive-img" alt="Git">
                        
                        <span class="card-title">Git</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            git专用名词Workspace：工作区
Index/Stage：暂存区
Repository：仓库区（或本地仓库）
Remote：远程仓库
用户名操作查看用户名：
git config user.name

查看用户邮箱：
git con
                        
                    </div>
                    <div class="publish-info">
                            <span class="publish-date">
                                <i class="far fa-clock fa-fw icon-date"></i>2020-08-18
                            </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/yueyueniao-gif/categories/git/" class="post-category">
                                    git
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/yueyueniao-gif/tags/git/">
                        <span class="chip bg-color">git</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
    </div>
</article>

</div>



<!-- 代码块功能依赖 -->
<script type="text/javascript" src="/yueyueniao-gif/libs/codeBlock/codeBlockFuction.js"></script>

<!-- 代码语言 -->

<script type="text/javascript" src="/yueyueniao-gif/libs/codeBlock/codeLang.js"></script>


<!-- 代码块复制 -->

<script type="text/javascript" src="/yueyueniao-gif/libs/codeBlock/codeCopy.js"></script>


<!-- 代码块收缩 -->

<script type="text/javascript" src="/yueyueniao-gif/libs/codeBlock/codeShrink.js"></script>


<!-- 代码块折行 -->

<style type="text/css">
code[class*="language-"], pre[class*="language-"] { white-space: pre !important; }
</style>


    </div>
    <div id="toc-aside" class="expanded col l3 hide-on-med-and-down">
        <div class="toc-widget">
            <div class="toc-title"><i class="far fa-list-alt"></i>&nbsp;&nbsp;目录</div>
            <div id="toc-content"></div>
        </div>
    </div>
</div>

<!-- TOC 悬浮按钮. -->

<div id="floating-toc-btn" class="hide-on-med-and-down">
    <a class="btn-floating btn-large bg-color">
        <i class="fas fa-list-ul"></i>
    </a>
</div>


<script src="/yueyueniao-gif/libs/tocbot/tocbot.min.js"></script>
<script>
    $(function () {
        tocbot.init({
            tocSelector: '#toc-content',
            contentSelector: '#articleContent',
            headingsOffset: -($(window).height() * 0.4 - 45),
            collapseDepth: Number('0'),
            headingSelector: 'h2, h3, h4'
        });

        // modify the toc link href to support Chinese.
        let i = 0;
        let tocHeading = 'toc-heading-';
        $('#toc-content a').each(function () {
            $(this).attr('href', '#' + tocHeading + (++i));
        });

        // modify the heading title id to support Chinese.
        i = 0;
        $('#articleContent').children('h2, h3, h4').each(function () {
            $(this).attr('id', tocHeading + (++i));
        });

        // Set scroll toc fixed.
        let tocHeight = parseInt($(window).height() * 0.4 - 64);
        let $tocWidget = $('.toc-widget');
        $(window).scroll(function () {
            let scroll = $(window).scrollTop();
            /* add post toc fixed. */
            if (scroll > tocHeight) {
                $tocWidget.addClass('toc-fixed');
            } else {
                $tocWidget.removeClass('toc-fixed');
            }
        });

        
        /* 修复文章卡片 div 的宽度. */
        let fixPostCardWidth = function (srcId, targetId) {
            let srcDiv = $('#' + srcId);
            if (srcDiv.length === 0) {
                return;
            }

            let w = srcDiv.width();
            if (w >= 450) {
                w = w + 21;
            } else if (w >= 350 && w < 450) {
                w = w + 18;
            } else if (w >= 300 && w < 350) {
                w = w + 16;
            } else {
                w = w + 14;
            }
            $('#' + targetId).width(w);
        };

        // 切换TOC目录展开收缩的相关操作.
        const expandedClass = 'expanded';
        let $tocAside = $('#toc-aside');
        let $mainContent = $('#main-content');
        $('#floating-toc-btn .btn-floating').click(function () {
            if ($tocAside.hasClass(expandedClass)) {
                $tocAside.removeClass(expandedClass).hide();
                $mainContent.removeClass('l9');
            } else {
                $tocAside.addClass(expandedClass).show();
                $mainContent.addClass('l9');
            }
            fixPostCardWidth('artDetail', 'prenext-posts');
        });
        
    });
</script>

    

</main>


<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=default"></script>

    <footer class="page-footer bg-color">
    
        <link rel="stylesheet" href="/yueyueniao-gif/libs/aplayer/APlayer.min.css">
<style>
    .aplayer .aplayer-lrc p {
        font-size: 12px;
        font-weight: 700;
        line-height: 16px !important;
    }

    .aplayer .aplayer-lrc p.aplayer-lrc-current {
        font-size: 15px;
        color: #42b983;
    }

    
    .aplayer.aplayer-fixed.aplayer-narrow .aplayer-body {
        left: -66px !important;
    }

    .aplayer.aplayer-fixed.aplayer-narrow .aplayer-body:hover {
        left: 0px !important;
    }

    
</style>
<div class="">
    
    <div class="row">
        <meting-js class="col l8 offset-l2 m10 offset-m1 s12"
                   server="netease"
                   type="playlist"
                   id="2566555574"
                   fixed='true'
                   autoplay='false'
                   theme='#42b983'
                   loop='all'
                   order='random'
                   preload='auto'
                   volume='0.7'
                   list-folded='true'
        >
        </meting-js>
    </div>
</div>

<script src="/yueyueniao-gif/libs/aplayer/APlayer.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js"></script>

    
    <div class="container row center-align" style="margin-bottom: 0px !important;">
       <h2>没有任何动物比蚂蚁更勤奋，然而它却最沉默寡言</h2><br><br>
    </div>
</footer>

<div class="progress-bar"></div>


    <!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <span class="title"><i class="fas fa-search"></i>&nbsp;&nbsp;搜索</span>
            <input type="search" id="searchInput" name="s" placeholder="请输入搜索的关键字"
                   class="search-input">
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script src="/yueyueniao-gif/js/search.js"></script>
<script type="text/javascript">
$(function () {
    searchFunc("/yueyueniao-gif/search.xml", 'searchInput', 'searchResult');
});
</script>

    <!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fas fa-arrow-up"></i>
    </a>
</div>


    <script src="/yueyueniao-gif/libs/materialize/materialize.min.js"></script>
    <script src="/yueyueniao-gif/libs/masonry/masonry.pkgd.min.js"></script>
    <script src="/yueyueniao-gif/libs/aos/aos.js"></script>
    <script src="/yueyueniao-gif/libs/scrollprogress/scrollProgress.min.js"></script>
    <script src="/yueyueniao-gif/libs/lightGallery/js/lightgallery-all.min.js"></script>
    <script src="/yueyueniao-gif/js/matery.js"></script>

    <!-- Baidu Analytics -->

    <!-- Baidu Push -->

<script>
    (function () {
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        } else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>

    
    <script src="/yueyueniao-gif/libs/others/clicklove.js" async="async"></script>
    
    
    <script async src="/yueyueniao-gif/libs/others/busuanzi.pure.mini.js"></script>
    

    

    

    

    

    

    
    <script src="/yueyueniao-gif/libs/instantpage/instantpage.js" type="module"></script>
    

</body>

</html>
